<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" id="numInput" />
		<button onclick="foo()">执行</button>

		<script>
			function foo() {
				var num = numInput.value;
				for (var i = 0; i < num; i++) {
					console.log(i);
				}
			}
		</script>
	</body>
</html>
